/*
 * jxUtils Project (2013, 2014)
 * 
 * by Denilson Edinaldo Pinto
 * 
 * LGPL
 * Copyright (C) 2014
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.jxUtils.date;

/**
 * @author Denilson Edinaldo Pinto
 * @project jxUtils
 * @package org.jxUtils.date
 * @date 06/02/2013 - 22:04:10
 */
public class Moon {
	
	private PhaseMoon phaseMoon = PhaseMoon.NEW_MOON;
	
	/**
	 * 
	 */
	public Moon() {
	
	}
	
	/**
	 * @param phaseMoon
	 */
	public Moon(final PhaseMoon phaseMoon) {
	
		this.phaseMoon = phaseMoon;
	}
	
	/**
	 * @return the phaseMoon
	 */
	public PhaseMoon getPhaseMoon() {
	
		return phaseMoon;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(final Object obj) {
	
		if(this == obj) {
			return true;
		}
		if(obj == null) {
			return false;
		}
		if( !(obj instanceof Moon)) {
			return false;
		}
		final Moon other = (Moon)obj;
		if(phaseMoon == null) {
			if(other.phaseMoon != null) {
				return false;
			}
		}else if( !phaseMoon.equals(other.phaseMoon)) {
			return false;
		}
		return true;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
	
		final int prime = 31;
		int result = 1;
		result = prime * result + (phaseMoon == null ? 0 : phaseMoon.hashCode());
		return result;
	}
	
	/**
	 * @param phaseMoon
	 *        the phaseMoon to set
	 */
	public void setPhaseMoon(final PhaseMoon phaseMoon) {
	
		this.phaseMoon = phaseMoon;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
	
		return phaseMoon.toString();
	}
}
